package com.tencreat.domain.mall;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import com.tencreat.common.enums.OrderStatus;
import com.tencreat.common.enums.OrderType;
import com.tencreat.common.enums.PayType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;


/**
 * 充值(提现)订单对象 recharge_order
 *
 * @author wangkai
 * @date 2021-11-13
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("recharge_order")
public class RechargeOrder extends BaseEntity<RechargeOrder> {
    private static final long serialVersionUID = 1L;


    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;


    /**
     * 用户id
     */
    @TableField("uuid")
    @ApiModelProperty("用户id")
    @Excel(name = "用户id")
    private Long uuid;

    /**
     * 充值(提现)订单编号
     */
    @Excel(name = "订单编号")
    @ApiModelProperty(value = "订单编号")
    @TableField("`order_sn`")
    private String orderSn;


    /**
     * 充值(提现)订单状态
     */
    @Excel(name = "充值(提现)订单状态")
    @ApiModelProperty(value = "充值(提现)订单状态")
    @TableField("`order_status`")
    private OrderStatus orderStatus;


    /**
     * 交易金额
     */
    @Excel(name = "交易金额")
    @ApiModelProperty(value = "交易金额")
    @TableField("`trade_amount`")
    private BigDecimal tradeAmount;


    /**
     * 提货单金额
     */
    @Excel(name = "提货单金额")
    @ApiModelProperty(value = "提货单金额")
    @TableField("`goods_roll`")
    private BigDecimal goodsRoll;

    /**
     * 消费券金额
     */
    @Excel(name = "消费券金额")
    @ApiModelProperty(value = "消费券金额")
    @TableField("`consumer_roll`")
    private BigDecimal consumerRoll;

    /**
     * 付款id(第三方平台)
     */
    @Excel(name = "付款id(第三方平台)")
    @ApiModelProperty(value = "付款id(第三方平台)")
    @TableField("`pay_id`")
    private String payId;


    /**
     * 付款时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "付款时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("`pay_time`")
    private LocalDateTime payTime;


    /**
     * 付款方式
     */
    @Excel(name = "付款方式")
    @ApiModelProperty(value = "付款方式")
    @TableField("`pay_type`")
    private PayType payType;


    /**
     * 订单类型 7充值8提现
     */
    @Excel(name = "订单类型 关联OrderType枚举类")
    @ApiModelProperty(value = "订单类型 关联OrderType枚举类")
    @TableField("`order_type`")
    private OrderType orderType;


    /**
     * 备注
     */
    @Excel(name = "备注")
    @ApiModelProperty(value = "备注")
    @TableField("`remakers`")
    private String remakers;


    /**
     * 只有提现订单该字段才有值，对应原充值订单id
     */
    @Excel(name = "只有提现订单该字段才有值，对应原充值订单id")
    @ApiModelProperty(value = "只有提现订单该字段才有值，对应原充值订单id")
    @TableField("`original_order_id`")
    private Long originalOrderId;


    /**
     * 订单关闭时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "订单关闭时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("`order_close_time`")
    private LocalDateTime orderCloseTime;


    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    @TableField("`del_flag`")
    private String delFlag;


    /**
     * 租户ID
     */
    @Excel(name = "租户ID")
    @ApiModelProperty(value = "租户ID")
    @TableField("`tenant_id`")
    private Long tenantId;


}
